{template 'common/header'}
<div class='container' style='padding:0 5px 10px;margin:0;width:100%'>
<ul class="nav nav-tabs">
  <li {if $opp == 'setup'}class="active"{/if}><a href="{php echo $this->createWebUrl('setup');}">系统基本设置</a></li>
  <li {if $opp == 'message'}class="active"{/if}><a href="{php echo $this->createWebUrl('message');}">模板消息设置</a></li>
  <li {if $opp == 'tabbar'}class="active"{/if}><a href="{php echo $this->createWebUrl('tabbar',array('op' =>'display'));}">底部菜单<span style="color: red">(beta)</span>设置</a></li>
</ul>
</div>
<div class="main">
<form action="" method="post" class="form-horizontal form" enctype="multipart/form-data" onsubmit='return formcheck()'>
	    
<div class="panel we7-panel wxapp-upload-setting">
		<div class="panel-heading">底部导航栏设置</div>
		<div class="panel-body">
			<div class="we7-flex">
				<div class="view-img"><img src="/web/resource/images/wxapp/setting-02.png" alt="">
                
                <div id="js-weentrance-display" ng-controller="WxappEntranceCtrl">
                
	<table class="table we7-table table-hover site-list">
         <thead class="table we7-table">
		<tr>
			<th colspan="3" style="width:80px;">名称</th>
			<th colspan="3" style="width:100px;">小程序入口标识</th>
			<th colspan="3" style="width:50px;">操作</th>
		</tr>
        </thead>
        <tbody>
		<tr ng-repeat="module_info in moduleList">
			<td colspan="3">{{module_info.title}}</td>
			<td colspan="3">{{module_info.do}}</td>
			<td colspan="3">
			<a href="javascript:;" id="copy-{{module_info.eid}}" class="color-default" clipboard supported="supported" text="module_info.do" on-copied="success(module_info.eid)">复制</a>
			</td>
		</tr>
        <tbody>
	</table>
</div>
<script>
	angular.module('wxApp').value('config', {
		moduleList: {php echo !empty($module_info) ? json_encode($module_info) : 'null'},
	});
	angular.bootstrap($('#js-weentrance-display'), ['wxApp']);
	
	 function sendtypeshow(sf) {
		 
        if (sf==0) {
            $(".model").hide();
        } else {
			$(".model").show();
        }
    }
</script>
                </div>
				<div class="form-horizontal">
					<div class="form-group">
						<label class="col-xs-3 control-label">文字默认颜色</label>
						<div class="col-xs-9">
							{php echo tpl_form_field_color('color', $tabbar['color'])}
						</div>
					</div>

					<div class="form-group">
						<label class="col-xs-3 control-label">文字选中颜色</label>
						<div class="col-xs-9">
							{php echo tpl_form_field_color('selectedColor', $tabbar['selectedColor'])}
						</div>
					</div>

					<div class="form-group">
						<label class="col-xs-3 control-label">底部导航颜色</label>
						<div class="col-xs-9">
							{php echo tpl_form_field_color('backgroundColor', $tabbar['backgroundColor'])}
						</div>
					</div>
					<div class="form-group">
						<label class="col-xs-3 control-label">交界线颜色</label>
						<div class="col-xs-9">
							{php echo tpl_form_field_color('borderStyle', $tabbar['borderStyle'])}
						</div>
					</div>
                    <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 control-label">自定义开关</label>
                    <div class="col-sm-9 col-xs-9 col-md-7 col-xs-12">
                        <label class="radio-inline"><input type="radio"  name="tabbar_key" value="0" {if $tabbar['tabbar_key'] == 0|| $tabbar['tabbar_key']}checked{/if}>默认菜单</label>
                        <label class="radio-inline"><input type="radio"  name="tabbar_key" value="1" {if $tabbar['tabbar_key'] == 1 }checked{/if}>开启自定义菜单</label>
                    </div>
                </div>
                    <ul class="nav nav-tabs">
                    
	                <li{if empty($tabbar_list['lid']) && $operation == 'post'} class="active" {/if}><a href="{php echo $this->createWebUrl('tabbar',array('op' =>'post'))}"><span class = "btn btn-primary">添加菜单</span></a></li>
                    
	                {if !empty($tabbar_list['lid']) &&  $operation == 'post'}<li  class="active"><a href="{php echo $this->createWebUrl('tabbar',array('op' =>'post','lid'=>$tabbar_list['lid']))}">编辑菜单</a></li>{/if}
                    </ul>
                 {if $operation == 'display'}   
                 <table class="table table-hover">
                 
                    <thead class="table we7-table">
                    
						<tr>
							<th style="width:50px;">排序</th>
                            
                            <th style="width:50px;">默认</th>

							<th style="width:50px;">选中</th>

							<th style="width:80px;">名称</th>

							<th class="text-center" style="width:150px;">跳转</th>

							<th style="width:120px;">操作</th>

						</tr>
                        
					</thead>
                    
				 <tbody>
                    
                        {loop $tabbar_list $item}

				<tr>
                    
                    <td>{$item['sort']}</td>

					<td>{if !empty($item['iconPath'])}<img src="{$item['iconPath']}" width="25" height="25" />{else}<i class="fa fa-picture-o fa-2x"></i>{/if}</td>
                    
                    <td>{if !empty($item['selectedIconPath'])}<img src="{$item['selectedIconPath']}" width="25" height="25" />{else}<i class="fa fa-picture-o fa-2x"></i>{/if}</td>
                    
					<td>{$item['text']}</td>

					<td>{$item['pagePath']}</td>

					<td style="text-align:left;">

						<a href="{php echo $this->createWebUrl('tabbar', array('op' => 'post', 'lid' => $item['lid']))}" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="修改"><i class="fa fa-edit"></i></a>

						<a href="{php echo $this->createWebUrl('tabbar', array('op' => 'delete', 'lid' => $item['lid']))}"class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="删除"><i class="fa fa-times"></i></a>

					</td>

				</tr>
				{/loop}
                </tbody>
                </table>
                
{elseif $operation == 'post'}

<div class="main">
	<input type="hidden" name="lid" value="{$banner['lid']}" />
		<div class="panel panel-default">
			<div class="panel-heading">
				添加菜单
			</div>
			<div class="panel-body">
            
                 <div class="form-group">

					<label class="col-xs-12 col-sm-3 col-md-2 control-label">排序</label>

					<div class="col-sm-9 col-xs-12">

						<input type="text" name="sort" class="form-control" value="{$banner['sort']}" />

					</div>

				</div>
				 <div class="form-group">

					<label class="col-xs-12 col-sm-3 col-md-2 control-label">菜单名称</label>

					<div class="col-sm-9 col-xs-12">

						<input type="text" name="text" class="form-control" value="{$banner['text']}" />

					</div>

				</div>
             
				<div class="form-group">

					<label class="col-xs-12 col-sm-3 col-md-2 control-label">默认图标</label>
                    
					<div class="col-sm-9 col-xs-12">
                    
						{php echo tpl_form_field_image('iconPath', $banner['iconPath'])}
                        
                          <span class="help-block">图片比例：200：200，格式：png </strong></span>

					</div>

				</div>
            <div class="form-group">

					<label class="col-xs-12 col-sm-3 col-md-2 control-label">选中图标</label>
                    
					<div class="col-sm-9 col-xs-12">
                    
						{php echo tpl_form_field_image('selectedIconPath', $banner['selectedIconPath'])}
                        
                            <span class="help-block">图片比例：200：200，格式：png </strong></span>

					</div>

				</div>
                 <div class="form-group">
                    <label class="col-xs-12 col-sm-4 col-md-3 control-label"></span>跳转外部开关</label>
                    <div class="col-sm-9 col-xs-9 col-md-7 col-xs-12">
                        <label class="radio-inline"><input type="radio" onclick="sendtypeshow(0)" name="wx_key" value="0" {if $banner['wx_key'] == 0|| $banner['wx_key']}checked{/if}>内部跳转</label>
                        <label class="radio-inline"><input type="radio" onclick="sendtypeshow(1)" name="wx_key" value="1" {if $banner['wx_key'] == 1 }checked{/if}>开启外部跳转</label>
                        <div class="help-block">开启后方可跳转外部小程序</div>
                    </div>
                </div>
				  <div class="form-group model">

					<label class="col-xs-12 col-sm-3 col-md-2 control-label">跳转外小程序APPID</label>

					<div class="col-sm-9 col-xs-12">

						<input type="text" name="wx_appid" class="form-control" value="{$banner['wx_appid']}" />
                        
                        <span class="help-block">跳转到外小程序的APPID,内部跳转留空！</strong></span>
                        <span class="help-block">开启跳转外小程序，下面的小程序页面为外部小程序页面、留空为首页</strong></span>
					</div>

				</div>
               <div class="form-group">

					<label class="col-xs-12 col-sm-3 col-md-2 control-label">小程序页面地址</label>

					<div class="col-sm-9 col-xs-12">

						<input type="text" name="pagePath" class="form-control" value="{$banner['pagePath']}" />
                        
                        <span class="help-block">跳转到小程序哪个页面，如：（pages/index/index）</strong></span>

					</div>

				</div>

			</div>

		</div>

<div class="form-group">

	<input type="submit" name="submit" value="保存" class="btn btn-primary" />

	<input type="hidden" name="token" value="{$_W['token']}" />

	</div>

	</form>

</div>
{/if}
				</div>
			</div>
		</div>
        
		<div class="panel-footer">
        
	<input type="submit" name="submit" value="提交" class="btn btn-primary" />
	<input type="hidden" name="token" value="{$_W['token']}" />

		</div>
	</div>

</div>  
        
{template 'common/footer'}